<?
/*
 *
 *
 *
 *
 */

include("config.php");
include("libs/class.ami.php");
include("functions.php");

header("content-type: text/xml");
error_reporting(0);
$asterisk = new ami;
	
	// Establezco la conexion con el Asterisk
	if ($asterisk->open($mod_user,$mod_pass,$mod_host,$mod_port) === FALSE ) {
		$xml = print_err();
	} else {
		$xml  = "<conf>\n";
		$xml .= "\t<pbxstatus>up</pbxstatus>\n";
		$xml .= "\t<aststatus>up</aststatus>\n";
		$xml .= get_astuptime();
		$xml .= get_diskusage();
		$xml .= get_localtime();
		$xml .= get_pbxuptime();
		$xml .= get_iax2();
		$xml .= get_channels();
		$xml .= "</conf>\n";
	}

	echo $xml;
?>
